import { IConfig, IPlugin } from 'umi-types';
import defaultSettings from './defaultSettings';
import routes from './routes';

const { primaryColor } = defaultSettings;

const plugins: IPlugin[] = [
  [
    'umi-plugin-react',
    {
      antd: true,
      dva: {
        hmr: true,
      },
    },
  ],
];

export default {
  plugins,
  hash: true,
  targets: {
    ie: 11,
  },
  routes: routes,
  proxy: {
    '/api_v1': {
      // target: 'http://ipark-smurfs.dev.ii-ai.tech',
      // target: 'http://ipark-user.dev.ii-ai.tech/',
      target: 'https://ipark.external.ai-indeed.com',
      // target: 'http://192.168.0.91:9200/',
      changeOrigin: true,
      pathRewrite: { '^/api_v1': '' },
    },
  },
  theme: {
    'primary-color': primaryColor,
  },
} as IConfig;
